function getResultSync() {
    let n = getNum();
    console.log("n = ",n);
    // console.log(2);
}

async function getNum() { 
    let n = getPromise();
    await n;
    // console.log();
    n.then(res=> {
        console.log("res = ",res);
    })
    console.log(1);
    return n;
}

function getPromise() {
    return new Promise((resolve,reject) => {
        setTimeout(() => {
            console.log("r = ",1000);
            resolve(1000);
        },1000)
    });
}



getResultSync();